<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('往期岗位列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>岗位编码：</label>
                                <input type="text" name="postCode"/>
                            </li>
                            <li>
                                <label>岗位名称：</label>
                                <input type="text" name="postName"/>
                            </li>
                            <li hidden>
                                <label>岗位状态：</label>
                                <input type="text" name="postStatus" value="FINISHED"/>
                            </li>
                            <li hidden>
                                <label>岗位发布者：</label>
                                <input type="text" name="createUserId" th:value="${user.userId}"/>
                            </li>
                            <li>
                                <label>工作地址：</label>
                                <input type="text" name="workplace"/>
                            </li>
                            <li>
                                <label>联系电话：</label>
                                <input type="text" name="phone"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('wstudy:finished:edit')}]];
        var removeFlag = [[${@permission.hasPermi('wstudy:finished:remove')}]];
        var postStatusDatas = [[${@dict.getType('wst_post_status')}]];
        var statusDatas = [[${@dict.getType('wst_post_status')}]];
        var prefix = ctx + "wstudy/post";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "往期岗位",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'postId',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'postCode',
                    title: '岗位编码'
                },
                {
                    field: 'postName',
                    title: '岗位名称'
                },
                {
                    field: 'createUserId',
                    title: '创建者ID',
                    visible: false
                },
                {
                    field: 'updateUserId',
                    title: '更新者',
                    visible: false
                },
                {
                    field: 'postStatus',
                    title: '状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(postStatusDatas, value);
                    }
                },
                {
                    field: 'status',
                    title: '状态',
                    visible: false,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'needNum',
                    title: '招聘人数',
                    visible: false
                },
                {
                    field: 'actuals',
                    title: '招收人数'
                },
                {
                    field: 'salary',
                    title: '工资',
                    visible: false
                },
                {
                    field: 'mainwork',
                    title: '工作介绍',
                    visible: false
                },
                {
                    field: 'workplace',
                    title: '工作地址'
                },
                {
                    field: 'startTime',
                    title: '开始时间'
                },
                {
                    field: 'endTime',
                    title: '截止时间'
                },
                {
                    field: 'phone',
                    title: '联系电话',
                    visible: false
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="details(\'' + row.postId + '\')"><i class="fa fa-search"></i>详情</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        function details(id) {
            $.modal.openTab("详情",prefix+"/details/"+id)
        }
    </script>
</body>
</html>